<?php
use think\facade\Route;
Route::get('think', function () {
    return 'hello,ThinkPHP6!';
});
Route::group(function (){
    Route::get('swg','Index/Swagger'); //swagger接口
})->allowCrossDomain();
Route::group('common',function (){
    Route::get('addRoleForUser', 'common.Auth/addRoleForUser');
    Route::get('deleteRoleForUser', 'common.Auth/deleteRoleForUser');
    Route::get('deleteRolesForUser', 'common.Auth/deleteRolesForUser');
    Route::get('getRolesForUser', 'common.Auth/getRolesForUser');
    Route::get('getUsersForRole', 'common.Auth/getUsersForRole');
    Route::get('hasRoleForUser', 'common.Auth/hasRoleForUser');
    Route::get('addPermissionForUser', 'common.Auth/addPermissionForUser');
    Route::get('deletePermissionForUser', 'common.Auth/deletePermissionForUser');
    Route::get('deletePermissionsForUser', 'common.Auth/deletePermissionsForUser');
    Route::get('getPermissionsForUser', 'common.Auth/getPermissionsForUser');
    Route::get('hasPermissionForUser', 'common.Auth/hasPermissionForUser');
    Route::get('deleteRole', 'common.Auth/deleteRole');
    Route::get('deleteUser', 'common.Auth/deleteUser');
    Route::get('deletePermission', 'common.Auth/deletePermission');
})->allowCrossDomain();
Route::group('crm',function (){
    Route::get('workerList', 'crm.Worker/workerList');//员工列表
})->allowCrossDomain();
Route::group('project',function (){
    Route::get('projectList', 'project.Project/projectList');//项目列表
})->allowCrossDomain();
Route::group('user',function (){
    Route::get('menuList', 'user.Menu/menuList');//菜单列表
    Route::post('menuAdd', 'user.Menu/menuAdd');//菜单新增
    Route::post('menuSave', 'user.Menu/menuSave');//菜单编辑
    Route::get('menuDel', 'user.Menu/menuDel');//菜单删除
    Route::get('domainList', 'user.Domains/domainList');//分组列表
    Route::post('domainAdd', 'user.Domains/domainAdd');//分组新增
    Route::get('groupList', 'user.Groups/groupList');//分组列表
    Route::post('groupAdd', 'user.Groups/groupAdd');//分组新增
    Route::get('roleList', 'user.Roles/roleList');//角色列表
    Route::post('roleAdd', 'user.Roles/roleAdd');//角色新增
    Route::get('userList', 'user.User/userList');//用户列表
    Route::post('userAdd', 'user.User/userAdd');//用户新增
})->allowCrossDomain();
Route::group('auth',function (){
    Route::post('reg', 'user.Auth/reg');//注册
    Route::post('login', 'user.Auth/login');//用户登录
    Route::get('getMenu', 'user.Auth/getMenu');//获取菜单
    Route::get('roleAuthList', 'user.RolesAuth/roleAuthList'); //角色关联权限列表
    Route::post('roleAuthAdd', 'user.RolesAuth/roleAuthAdd'); //角色关联权限新增
})->allowCrossDomain();
Route::group('category',function (){
    Route::get('categoryList', 'category.Category/categoryList');//列表
	Route::post('categoryAdd', 'category.Category/categoryAdd');//新增
	Route::post('categorySave', 'category.Category/categorySave');//修改
})->allowCrossDomain();
Route::miss('Miss/index');